<template>
  <div class="block">
    <el-pagination
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      :current-page="currentPage"
      :page-sizes="[2, 5, 8, 10]"
      :page-size="pageSize"
      layout="total, sizes, prev, pager, next, jumper"
      :total="num">
    </el-pagination>
  </div>
</template>
<script>
  export default {
    props:['num','currentPage','pageSize'],
    methods: {
      handleSizeChange(val) {
        console.log(`每页 ${val} 条`);
        this.$emit('changeSize',val)
      },
      handleCurrentChange(val) {
        console.log(`当前页: ${val}`);
        this.$emit('changeCurrent',val)
      }
    },
  }
</script>